<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      /* 
        1=1*1;
        22=1*2+10*2
        333=1*3+10*3+100*3
      */
      /* 
        1=(10**0)*1;   0                    
        22=(10**0)*2+(10**1)*2   0 1
        333=(10**0)*3+(10**1)*3+(10**2)*3   0 1 2
      */
      let str = ""; //所有的结果拼接成字符串
      for (let i = 1; i <= 8; i++) {
        // 内层循环累加和
        let n = 0;
        for (let j = 0; j < i; j++) {
          n = n + 10 ** j * i;
        }
        str = str + n + "\n";
      }
      console.log(str);
    </script>
  </body>
</html>
